<?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
*
 ********************************************************************************/

require_once("PortalConfig.php");
require_once("language/$default_language.lang.php");
include("version.php");
include_once('include/utils/utils.php');

@session_start();
if(isset($_SESSION['customer_id']) && isset($_SESSION['customer_name']))
{
	header("Location: index.php?action=index&module=.'$module'");
	exit;
}
if($_REQUEST['close_window'] == 'true')
{
   ?>
	<script language="javascript">
        	window.close();
	</script>
   <?php
}
global $default_charset;
header('Content-Type: text/html; charset='.$default_charset);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
   <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
   <title><?php echo getTranslatedString('PAGE_TITLE');?></title>
   <link href="css/main.css" rel="stylesheet" type="text/css" />
   <link href="css/login.css" rel="stylesheet" type="text/css" /> 
   <script language="javascript" type="text/javascript" src="js/validateLogin.js"></script>
</head>
<body>
   <div id="wrap">
      <div id="header">
         <img src="images/loginVtigerCRM.gif" width="169" height="49">
      </div>
      <div id="main">
         <div id="login">
            <form name="login" action="CustomerAuthenticate.php" method="post">
               <?php
                  //Display the login error message 
                  if($_REQUEST['login_error'] != '') echo getTranslatedString(base64_decode($_REQUEST['login_error'])); 
               ?>
               <fieldset>
                  <legend><span><?php echo getTranslatedString('customerportal');echo " " .$version; ?></span></legend>
                  <div>
                     <label class="dvtCellLabel" for="username"><?php echo getTranslatedString('LBL_EMAILID');?></label>
                     <input type="text" name="username" id="username" class="detailedViewTextBox" />
                  </div>
                  <div>
                     <label class="dvtCellLabel" for="pw"><?php echo getTranslatedString('LBL_PASSWORD');?></label>
                     <input type="password" id="pw" name="pw" class="detailedViewTextBox" />
                  </div>
                  <div>
                     <label class="dvtCellLabel" for="login_language"><?php echo getTranslatedString('LBL_LANGUAGE');?></label>
                     <select name="login_language">
                        <?php echo getPortalLanguages(); ?>	
                     </select>
                  </div>
                  <div id="help">
                     <a href='javascript:;' onclick='window.open("supportpage.php?param=forgot_password","ForgotPassword","width=400,height=250");'>
                        <?php  echo getTranslatedString('LBL_FORGOT_LOGIN');?>
                     </a>
                  </div>
                  <div id="signin"> 
                     <input type="image" src="images/loginBtnSignin.gif" onclick="return validateLoginDetails();">
                  </div>
                  <div id="login_note">
                     <span><?php  echo getTranslatedString('LBL_LOGIN_NOTE');?></span>
                  </div>
               </fieldset>
            </form>
         </div>
      </div>
      <div id="footer">
         <div id="url"></div>
         <span><?php echo getTranslatedString(customerportal) . " " . $version . "-" . $hack; ?></span>
      </div>        
   </div><!-- End of Wrap -->
</body>
</html>
